﻿Imports Microsoft.Reporting.WinForms
Imports System.Data.SqlClient

Public Class Sellreport

    Private Sub Sellreport_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        condb()
        Dim cmd As New SqlCommand
        cmd.Connection = cn
        cmd.CommandText = "select * from tblinvoice where date between'" & startistic.startdate.Value & "' and '" & startistic.enddate.Value & "' "
        Dim dr = cmd.ExecuteReader
        Dim dt As New DataTable
        dt.Load(dr)
        dr.Close()
        Me.ReportViewer1.LocalReport.DataSources.Add(New ReportDataSource("DataSet1", dt))
        Me.ReportViewer1.LocalReport.ReportEmbeddedResource = "WindowsApplication2.statisticreprot.rdlc"
        Me.ReportViewer1.SetDisplayMode(DisplayMode.PrintLayout)
        Me.ReportViewer1.ZoomMode = ZoomMode.FullPage
        Me.ReportViewer1.RefreshReport()
        Main.lblheader.Text = "របាយការណ៍ប្រចាំថ្ងៃ"
    End Sub
End Class